<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8">
		<title>会员信息</title>
		[#include "/common/include.ftl"/]
		<link type="text/css" rel="styleSheet" href="${base}/resource/css/member.css">
		<script type="text/javascript" src="${base}/resource/plug/My97DatePicker/WdatePicker.js"></script>
		<script type="text/javascript" src="${base}/resource/js/member.js"></script>
		<script type="text/javascript" src="${base}/resource/plug/citySelect/jquery.cityselect.js"></script>
		<script type="text/javascript">
			$(function(){
			 	var cS = '929 956 957'.split(' '), prov = $('#element_id').attr('prov');
			    if (prov) {
			        cS = prov.replace(/^,|,$/, '').split(',');
			    }
			    if (cS.length == 2)
			        cS[2] = '';
			    $('#element_id p:first').citySelect({
			        url: base + '/resource/plug/citySelect/city.min.js',
			        prov: cS[0],
			        city: cS[1],
			        dist: cS[2]
			    });
				$(".change-info").click(function(){
					var name = $("#name").val();
					if(!name || name == ''){
						oDialog.prompt("请填写昵称！");
						return;
					}
					var sex = $("[name='sex']:checked").val();
					var birthday = $("#birthday").val();
					var address	= $("#adress").val();
					var area = $(".dist").val();
					if(!area || area == ''){
						area = $(".city").val();
					}else{
						area = $(".city").val() + ',' + area;
					}
					if(!area || area == ''){
						area = $(".prov").val();
					}else{
						area = $(".prov").val() + ',' + area;
					}
					ajax({
						url	: base + "/member/saveInfo.jhtml",
						data: {
							name	: name,
							sex		: sex,
							birthday: birthday,
							areaTree: area,
							address	: address
						},
						showError:true,
						success	: function(){
							oDialog.prompt("修改成功");
						}
					});
				});
			});
		</script>
	</head>
	<body class="customer">
		[#include "/common/header.ftl"/]
		<div class="crumbs">
			<a href="${base}/member/index.jhtml">会员中心</a>
			<i style='font-family: simsun;font-style: normal;'>></i>
			<a>账户中心</a>
			<i style='font-family: simsun;font-style: normal;'>></i>
			<a>会员信息</a>
		</div>
		<div id="member-main">
			[#assign menuNo='info'/]
			[#include "/common/member-left.ftl"/]
			<div class="member-right">
				<div class="right-wrap">
					<h2 class="right-title">会员信息</h2>
					<div class="mc mc-list member-info-table">
						<div class="form">
							<form id="member-info-form">
								<div class="item">
									<div class="label">
										用户名：
									</div>
									<div class="fl">
										<strong>${member.username}</strong>
									</div>
									<div class="clear"></div>
								</div>
								<div class="item">
									<div class="label">
										昵称：
									</div>
									<div class="fl">
										<input type="text" class="text" id="name" value="${member.name!''}"/>
									</div>
									<div class="clear"></div>
								</div>
								<div class="item">
									<div class="label">
										手机号：
									</div>
									<div class="fl">
										[#if member.mobile]
											<strong>${member.safeMobile}</strong><a href="${base}/member/mobile.jhtml" class="go">[修改]</a>
										[#else]
											<strong>未设置 </strong><a href="${base}/member/safe.jhtml" class="go">[去验证]</a>
										[/#if]
									</div>
									<div class="clear"></div>
								</div>
								<div class="item">
									<div class="label">
										邮箱：
									</div>
									<div class="fl">
										[#if member.email]
											<strong>${member.safeEmail} </strong><a href="${base}/member/validEmail.jhtml" class="go">[修改]</a>
										[#else]
											<strong>未设置 </strong><a href="${base}/member/validEmail.jhtml" class="go">[去验证]</a>
										[/#if]
									</div>
									<div class="clear"></div>
								</div>
								<div class="item">
									<div class="label">
										性别：
									</div>
									<div class="fl">
										<input type="radio" value="true" name="sex" [#if member.sex?? && member.sex]checked="true"[/#if]/>
										<label>男</label>
										<input type="radio" value="false" name="sex" [#if member.sex?? && !member.sex]checked="true"[/#if]/>
										<label>女</label>
										<input type="radio" name="sex" [#if !member.sex??]checked="true"[/#if]>
										<label>保密</label>
									</div>
									<div class="clear"></div>
								</div>
								<div class="item">
									<div class="label">
										生日：
									</div>
									<div class="fl">
										<input type="text" class="text" id="birthday" value="${(member.birthday?string('yyyy-MM-dd'))!''}" readonly="readonly" onClick="WdatePicker({dateFmt:'yyyy-MM-dd',maxDate:'%y-%M-%d'})"/>
										<span>如： 2010-02-03</span>
									</div>
									<div class="clear"></div>
								</div>
								<div class="item">
									<div class="label">
										<span>详细地址：</span>
									</div>
									<div id="element_id" prov="${member.areaTree!}" class="fl">
										<p>
											<select class="sele prov"></select>
											<select class="sele city"></select>
											<select class="sele dist"></select>
										</p>
										<p>
											<input type="text" class="text" id="adress" value="${member.address!''}"/>
										</p>
									</div>
									<div class="clear"></div>
								</div>
								<div class="item">
									<div class="label"></div>
									<div class="fl">
										<button type="button" class="hp-button change-info">修改</button>
									</div>
								</div>
							</form>
						</div>
					</div>
				</div>
			</div>
			<div class="clear"></div>
		</div>
		[#include "common/footer-slidebar-lazyload.ftl"]
	</body>
</html>